package com.vanguard.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

/**
 * @Title: 字符编码、解码工厂类，编码过滤工厂
 * @Description:
 * @Author: vanguard
 * @Version: 1.0
 * @Date: 2018/12/25
 */
public class CharsetCodecFactory implements ProtocolCodecFactory {

    @Override
    public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception {

        return new CharsetEncoder();
    }

    @Override
    public ProtocolDecoder getDecoder(IoSession ioSession) throws Exception {
        return new CharsetDecoder();
    }
}
